package com.example.demo.exception;

import com.example.demo.enums.BusinessEnum;

public class BusinessException extends Exception{

    protected Long code;

    public BusinessException() { super(); }

    public BusinessException(String message) {
        super(message);
    }

    public BusinessException(String message, Long code) {
        super(message);
        this.code = code;
    }

    public Long getCode()
    {
        return code;
    }

    public BusinessException(BusinessEnum businessEnum) {
        super(businessEnum.message);
        this.code = businessEnum.code;
    }

}
